#An event handler test
from direct.showbase import DirectObject
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from panda3d.core import PointLight
from panda3d.core import Vec3,Vec4,Point3,Point2
from panda3d.core import CollisionRay,CollisionNode,GeomNode,CollisionTraverser
from panda3d.core import CollisionHandlerQueue, CollisionSphere, BitMask32
from panda3d.core import TransparencyAttrib
from direct.gui.OnscreenText import OnscreenText
from pandac.PandaModules import TextNode
from MapGenerator import MapGenerator
from Event import EventBase

class Inputs:
    """description of class"""
    pass
    def __init__(self):
        self.MouseListener = EventBase()
        self.KeyboardListener = EventBase()

    def InitKeyboard(self, target):
        if target != None:
            target.accept('arrow_up', self.KeyboardListener, ['arrow_up'])
            target.accept('arrow_down', self.KeyboardListener, ['arrow_down'])
            target.accept('arrow_left', self.KeyboardListener, ['arrow_left'])
            target.accept('arrow_right', self.KeyboardListener, ['arrow_right'])
            target.accept('arrow_up-repeat', self.KeyboardListener, ['arrow_up-repeat'])
            target.accept('arrow_down-repeat', self.KeyboardListener, ['arrow_down-repeat'])
            target.accept('arrow_left-repeat', self.KeyboardListener, ['arrow_left-repeat'])
            target.accept('arrow_right-repeat', self.KeyboardListener, ['arrow_right-repeat'])
            target.accept('escape', self.KeyboardListener, ['escape'])

    def InitMouse(self, target):
        if target != None:
            target.accept('mouse1-up', self.MouseListener, ['mouse1-up'])
            target.accept('wheel_up', self.MouseListener, ['wheel_up'])
            target.accept('wheel_down', self.MouseListener, ['wheel_down'])
            target.accept('mouse3', self.MouseListener, ['mouse3'])
            target.accept('mouse3_up', self.MouseListener, ['mouse3_up'])
